package org.spark.api.example

import org.apache.spark.sql.SparkSession

object Example1 {


  def main(args: Array[String]): Unit = {

    val log  = getClass.getClassLoader.getResource("Readme.md").getPath

    val spark = SparkSession.builder().appName("Example1").master("local").getOrCreate()

//    spark.sparkContext.textFile()
    val logData = spark.read.textFile(log)
//      .cache()

//    val numAs = logData.filter(line => line.contains("a")).count()
//
//    val numBs = logData.filter(line => line.contains("b")).count()
//
//    println(s"Lines with a: $numAs, Lines with b: $numBs")

//    spark.sparkContext.broadcast()
    spark.stop()

  }

}
